/**
 * Created by Laggo on 11/5/15.
 */
app.config(['$stateProvider', '$urlRouterProvider', function ($stateProvider, $urlRouterProvider) {
    $urlRouterProvider.otherwise("/login");
    $stateProvider
        .state('login', {
            url: "/login",
            templateUrl: "www/html/login.html",
            controller: "loginController"
        })
        .state('admin', {
            url: "/admin",
            templateUrl: "www/html/admin.html",
            controller: "adminController"
        })
        .state('admin.welcome', {
            url: "/welcome",
            templateUrl: "www/html/welcome.html",
            controller: "welcomeController"
        })

        //线下客户管理
        .state('admin.lineCustomer', {
            url: "/lineCustomer/",
            templateUrl: "www/html/lineCustomer/lineCustomer.html",
            controller: "lineCustomerController"
        })
        .state('admin.addLineCustomer', {
            url: "/addLineCustomer",
            templateUrl: "www/html/lineCustomer/lineCustomerDetail.html",
            controller: "addLineCustomerController"
        })
        .state('admin.updateLineCustomer', {
            url: "/updateLineCustomer/:lineCustomerId",
            templateUrl: "www/html/lineCustomer/lineCustomerDetail.html",
            controller: "updateLineCustomerController"
        })

        //预订单
        .state('admin.linePreOrder', {
            url: "/linePreOrder",
            templateUrl: "www/html/linePreOrder/linePreOrder.html",
            controller: "linePreOrderController"
        })

        .state('admin.addLinePreOrder', {
            url: "/addLinePreOrder/:id",
            templateUrl: "www/html/linePreOrder/addLinePreOrder.html",
            controller: "addLinePreOrderController"
        })

        //采购单
        .state('admin.linePurchaseOrder', {
            url: "/linePurchaseOrder",
            templateUrl: "www/html/linePurchaseOrder/linePurchaseOrder.html",
            controller: "linePurchaseOrderController"
        })
        .state('admin.linePurchaseOrderDetail', {
            url: "/linePurchaseOrderDetail/:id/:page",
            templateUrl: "www/html/linePurchaseOrder/linePurchaseOrderDetail.html",
            controller: "linePurchaseOrderDetailController"
        })
        .state('admin.todayPurchaseOrder', {
            url: "/todayPurchaseOrder/",
            templateUrl: "www/html/linePurchaseOrder/todayPurchaseOrder.html",
            controller: "todayPurchaseOrderController"
        })
        .state('admin.sortOrder', {
            url: "/sortOrder/",
            templateUrl: "www/html/linePurchaseOrder/sortOrder.html",
            controller: "sortOrderController"
        })


        //类目管理
        .state('admin.category', {
            url: "/categoryList",
            templateUrl: "www/html/categoryManager/categoryManagerList.html",
            controller: "categoryManagerController"
        })
        //商品管理
        .state('admin.commodity', {
            url: "/commodity",
            templateUrl: "www/html/commodity/commodity.html",
            controller: "commodityContorller"
        })
        .state('admin.addCommodity', {
            url: "/addCommodity",
            templateUrl: "www/html/commodity/commodityDetail.html",
            controller: "addCommodityContorller"
        })


        .state('admin.updateCommodity', {
            url: "/updateCommodity/:commodityUpdateID",
            templateUrl: "www/html/commodity/commodityDetail.html",
            controller: "updateCommodityContorller"
        })
        .state('admin.lineOrder', {
            url: "/lineOrder/:id",
            templateUrl: "www/html/lineOrder/lineOrder.html",
            controller: "lineOrderContorller"
        })

        .state('admin.todayOrder', {
            url: "/todayOrder",
            templateUrl: "www/html/lineOrder/todayOrder.html",
            controller: "todayOrderContorller"
        })
        //库存管理
        .state('admin.stock', {
            url: "/stockList",
            templateUrl: "www/html/stock/stockList.html",
            controller: "stockListController"
        })

        //订单管理
        .state('admin.order', {
            url: "/order",
            templateUrl: "www/html/order/orderList.html",
            controller: "orderContorller"
        })



        //销售用户管理
        .state('admin.seller', {
            url: "/seller",
            templateUrl: "www/html/sell/sellList.html",
            controller: "sellListContorller"
        })
        .state('admin.updateSeller', {
            url: "/updateSeller/:id",
            templateUrl: "www/html/sell/addSeller.html",
            controller: "updateSellerContorller"
        })


        //打印
        .state('orderPrint', {
            url: "/orderPrint/:id/:orderArr",
            templateUrl: "www/html/lineOrder/print.html",
            controller: "orderPrintContorller"
        })
        .state('purchasePrint', {
            url: "/purchasePrint/:id/:Soring",
            templateUrl: "www/html/linePurchaseOrder/print.html",
            controller: "purchasePrintController"
        })

        //demo
        .state('demo', {
            url: "/demo",
            templateUrl: "www/html/demo.html",
            controller: "demoController"
        })
        //管理组权限
        .state('admin.manager', {
            url: "/manager",
            templateUrl: "www/html/manager/manager.html",
            controller: "managerController"
        })
        //后台用户管理
        .state('admin.role', {
            url: "/role",
            templateUrl: "www/html/manager/role.html",
            controller: "roleController"
        })
}]);
